import axios from "axios";
import { req, reqJson } from "./axiosFun";
/**
 * 接口文件配置
 **/
// 文件配置-获取文件配置列表
export const InterfileConfigList = params => {
  return reqJson("post", "/api/interfile/v1/list_file_config", params);
};
// 文件配置-新增文件配置
export const InterfileConfigAdd = params => {
  return reqJson("post", "/api/interfile/v1/add_file_config", params);
};
// 文件配置-更新文件配置
export const InterfileConfigUpdate = params => {
  return reqJson("post", "/api/interfile/v1/update_file_config", params);
};
// 文件配置-删除文件配置
export const InterfileConfigDelete = params => {
  return axios
    .delete(
      "/api/interfile/v1/delete_file_config/?id=" +
        params +
        "&token=" +
        localStorage.getItem("logintoken")
    )
    .then(res => res.data);
};
// 查询文件的字段列表
export const FieldConfigList = params => {
  return reqJson("post", "/api/interfile/v1/list_field_config", params);
};
// 添加字段配置
export const FieldConfigAdd = params => {
  return reqJson("post", "/api/interfile/v1/add_field_config", params);
};
// 字段配置-删除字段配置
export const FieldConfigDelete = params => {
  return axios
    .delete(
      "/api/interfile/v1/delete_field_config/?id=" +
        params +
        "&token=" +
        localStorage.getItem("logintoken")
    )
    .then(res => res.data);
};

// 文件配置-更新文件配置
export const FieldConfigUpdate = params => {
  return reqJson("post", "/api/interfile/v1/update_field_config", params);
};

// 查询字段属性列表
export const FieldAttrConfigList = params => {
  return reqJson("post", "/api/interfile/v1/list_field_attr_config", params);
};
// 添加字段属性配置
export const FieldAttrConfigAdd = params => {
  return reqJson("post", "/api/interfile/v1/add_field_attr_config", params);
};
// 属性配置-删除字段属性配置
export const FieldAttrConfigDelete = params => {
  return axios
    .delete(
      "/api/interfile/v1/delete_field_attr_config/?id=" +
        params +
        "&token=" +
        localStorage.getItem("logintoken")
    )
    .then(res => res.data);
};

// 属性配置-更新字段属性配置
export const FieldAttrConfigUpdate = params => {
  return reqJson("post", "/api/interfile/v1/update_field_attr_config", params);
};

